<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录页面</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
	
  </head>
  <body>
  	<form class="form-horizontal" name="myForm">
		<fieldset>
			<legend>请登录：</legend>
			<div class="control-group">
				<label class="control-label" for="input01">您的尊姓大名：</label>
				<div class="controls">
					<input type="text" id="input01" class="input-xlarge" name="name"/>
				</div>
			</div>
			
			<div class="control-group"> 
				<label class="control-label" for="input02">您的密码：</label>
				<div class="controls">
					<input type="text" class="input-xlarge" id="input01" name="password">
				</div>
			</div>
			
			<div class="control-group">
				<div class="checkbox"><label><input type="checkbox"/>记住密码</label></div>
			</div>
			
			<div class="col-sm-offset-2 col-sm-10">
				<button type="button" class="btn btn-info" id="login">登录</button>
			</div>
		</fieldset>
	</form>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
    $(document).ready(
    		function() {
				
			
    $("#login").click(function() {
    	alert(JSON.stringify(GetJsonData()));
        $.ajax({
            type: 'POST',
            url: 'http://192.168.1.94:8088/RestaurantServer/user/doReg',
            contentType: 'application/json; charset=utf-8',
            data: JSON.stringify(GetJsonData()) ,
           
            dataType: 'json',
            success: function (message) {
            	alert(message);
                alert(message.RESULT);
            }
        });
    });
    function GetJsonData() {
        var json = {
            "userName": myForm.name.value,
            "userPassword": myForm.password.value,
        };
        return json;
    };
    		});
    </script>
  </body>
</html>